<template>
    <div>
      <div class="box">
  
      </div>
      <div class="box">
        <el-table
            :data="tableData"
            border
            style="width: 100%">
            <el-table-column
              prop="userId"
              label="ID"
              width="80">
            </el-table-column>
            <el-table-column
              prop="nickName"
              label="用户昵称"
              width="180">
            </el-table-column>
            <el-table-column
              prop="realName"
              label="真实姓名">
            </el-table-column>
            <el-table-column
              prop="mobile"
              label="手机号">
            </el-table-column>
            <el-table-column
              prop="askContent"
              label="反馈信息">
            </el-table-column>
            <el-table-column
              prop="createTime"
              label="提交时间">
            </el-table-column>
          </el-table>
      </div>
  
      <div style="margin: 10px;">
        <el-pagination
          background
          layout="total, sizes, prev, pager, next, jumper"
          :current-page="pageNum"
          :page-sizes="[10, 15, 20, 30]"
          :page-size="pageSize"
          :total="total"
          @current-change="handleCurrentChange"
          @size-change="handleSizeChange"
          >
        </el-pagination>
      </div>
    </div>
  </template>
  
  <script>
    import {getVipAskBypage} from '@/api/news.js'
    export default {
      name: 'VipUserAskPage',
      data() {
        return {
          tableData: [],
          total: 0,
          pageSize: 10,
          pageNum: 1,
        }
      },
      mounted() {
        this.loadList()
      },
      methods: {
        loadList() {
          let param = {
            pageNum: this.pageNum,
            pageSize: this.pageSize
          }
          getVipAskBypage(param).then(res => {
            console.log('getVipAskBypage', res);
            if(res.code == 200) {
              this.tableData = res.data.records
              this.pageNum = res.data.current
              this.pageSize = res.data.size
              this.total = res.data.total
            }
          })
        },
        handleCurrentChange(val) {
          console.log(`当前页: ${val}`)
          this.pageNum = val
          this.loadList()
        },
        handleSizeChange(val) {
          console.log(`每页 ${val} 条`)
          this.pageSize = val
          this.loadList()
        },
      }
    }
  </script>
  
  <style>
  </style>
  